import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);

/**
 * (resolve) => require(['@/components/teacher/TeacherInfoCase.vue'], resolve) 这种方式有利于减轻项目第一次加载网页的负担
 */

const router = new Router({
  linkActiveClass: "active",
  scrollBehavior(to, from, savedPosition) {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({ x: 0, y: 1 });
      }, 0);
    });
  },
  mode: 'history',
  routes: [
    //领红包
    {
      path: "/",
      name: "linghongbao",
      component: () => import("@/views/linghongbao.vue")
    },
    {
      path: "/linghongbao",
      name: "linghongbao",
      component: () => import("@/views/linghongbao.vue")
    },
    //红包详情
    {
      path: "/hongbaodetail",
      name: "hongbaoDetail",
      component: () => import("@/views/hongbaodetail.vue")
    },
    //验证手机号
    {
      path: "/bangdingshoujihao",
      name: "bangdingshoujihao",
      component: () => import("@/views/bangdingshoujihao.vue")
    },
    // cxr 下载页
    {
      path: "/xiazaiye",
      name: "xiazaiye",
      component: () => import("@/views/xiazaiye.vue")
    }
  ]
});

export default router
